export function initMap(mapId) {
  Cesium.Ion.defaultAccessToken =
    "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhYTNiMDIxZS02NjMyLTQ0MTgtYTY0NS1kYzMwYjZkZDllZTIiLCJpZCI6MTIyNjgwLCJpYXQiOjE2NzUwNDU3NjR9.YAIh-_IFBWrprAoLkJHZGh8oLjJHDemH62_enMlVu1E";
  window.viewer = new Cesium.Viewer(mapId, {
    homeButton: true,
    sceneModePicker: false,
    baseLayerPicker: false, // 影像切换
    animation: false, // 是否显示动画控件
    infoBox: false, // 是否显示点击要素之后显示的信息
    selectionIndicator: false, // 要素选中框
    geocoder: false, // 是否显示地名查找控件
    timeline: false, // 是否显示时间线控件
    fullscreenButton: false,
    shouldAnimate: false,
    navigationHelpButton: false, // 是否显示帮助信息控件
  });
  setTimeout(() => {
    console.log("go to china");
    window.viewer.scene.camera.flyTo({
      destination: Cesium.Cartesian3.fromDegrees(113, 16, 2500000),
      orientation: {
        heading: Cesium.Math.toRadians(0),
        pitch: Cesium.Math.toRadians(-90),
        roll: 0,
      },
    });
  }, 500);
}
